package cn.stronglink.assetmanage.business.setting;


import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import cn.stronglink.assetmanage.R;
import cn.stronglink.assetmanage.utils.APKVersionCodeUtils;

/**
 * A simple {@link Fragment} subclass.
 */
public class SystemInfoFragment extends Fragment {
    @BindView(R.id.txtSystemVails)
    TextView txtSystemVails;
    @BindView(R.id.txtSystemName)
    TextView txtSystemName;
    @BindView(R.id.txtSystemNum)
    TextView txtSystemNum;
    private Unbinder unbinder;

    public SystemInfoFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_system_info, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        txtSystemVails.setText("资产管理系统");
        //显示app版本
        txtSystemName.setText("V" + APKVersionCodeUtils.getVerName(getActivity()));
        //显示手持Android版本
        txtSystemNum.setText("V" + Build.VERSION.RELEASE);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

}
